package com.sdtv.mediunfusion.mvp.contract;

import android.util.Log;

import com.sdtv.basemodule.mvp.presenter.BasePresenter;
import com.sdtv.basemodule.rx.BaseObserver;
import com.sdtv.mediunfusion.bean.TestBean;

import java.util.List;

/**
 * @ProjectName: MediunFusion
 * @Package: com.sdtv.mediunfusion.mvp.contract
 * @ClassName: MainPresenter
 * @Description: Presenter
 * @Author: 小郭同学
 * @CreateDate: 2019-07-02 14:50
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public class MainPresenter extends BasePresenter<MainContract.MainView, MainModel> {

    private static final String TAG = "MainPresenter";

    @Override
    public void initRepository() {
        mModel = new MainModel(mView);
    }

    /**
     * 获取数据开始 ----
     */
    public void getTestData() {
        mModel.getWanArticleList("1").subscribe(
                new BaseObserver<TestBean.DatasBean>(TestBean.DatasBean.class,
                        "page1") {
                    @Override
                    public void doNextList(int totalCount, List<TestBean.DatasBean> result) {
                        Log.e(TAG, "doNext:---获取数据成功了 呀呀呀 " + result.size());
                        mView.changeText("---yo uouo ---" + result.get(0).getAuthor());

                    }

                });
    }


}
